<template>
  <el-dialog
    append-to-body
    title="用户隐私协议"
    :visible.sync="dialogVisible"
    top="5%"
    width="95%">
    <div class="content-outer my-scroller" :style="frameStyle" v-html="content">
<!--      <iframe :src="'http://www.yangfankj.com/yinsi.html'" frameborder="0" :style="frameStyle"></iframe>-->
    </div>
    <div slot="footer" v-if="!isNoAct" class="dialog-footer" align="center">
      <el-button type="success" @click="agree">同意</el-button>
<!--      <el-button type="danger" @click="refuse">拒绝</el-button>-->
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'MyPrivacyAgreementDialog',
  data:function () {
    return {
      dialogVisible:false,
      isNoAct:false,
      content:'',
      frameStyle:{
        width:'95%',
        height:(this.getWinSize().height-250)+'px'
      }
    }
  },
  methods:{
    agree:function () {
      localStorage.setItem('MyPrivacyAgreement','1')
      this.bus.$emit('MyPrivacyAgreementCallBus')
      this.dialogVisible=false
      this.$forceUpdate()
    },
    refuse: function(){
      // this.$message.warning('拒绝App使用协议,2秒后关闭应用')
      // localStorage.removeItem("AppAgreement")
      // localStorage.removeItem("MyPrivacyAgreement")
      // setTimeout(function (){
      //   location.replace('/static/privacy_dialog/index.html')
      // },2000)
    },
    open:function () {
      this.dialogVisible=true
      this.getContent()
      this.$forceUpdate()
    },
    getContent:function () {
      let $this=this
      $this.MyRequest($this.ApiDoNameCommon+'Public/privacyAgreementMember',{type:'json'},function (data) {
        $this.content=data
        $this.$forceUpdate()
        // console.log(data)
      })
    }
  }
}
</script>

<style scoped>
  .content-outer{
    line-height: 20px; font-size: 12px; text-align: left; text-indent: 20px; overflow-y: auto; overflow-x:hidden;
    color: #555555;
  }
</style>
